<!--
 * @Author: your name
 * @Date: 2021-08-10 21:45:16
 * @LastEditTime: 2021-08-16 10:53:51
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \familyDoctor\doctor\src\views\main.vue
-->
<template>
  <div id="main">
    <!-- 头部导航栏 -->
    <div class="header-nav">
      <Header></Header>
    </div>
    <!-- 左侧导航栏 -->
    <!-- <div class="left-nav">
      <Aside></Aside>
      <div class="right-main">
        <router-view></router-view>
      </div>
    </div> -->
    <el-container>
      <el-aside class="aside-nav" width='200px'>
        <Aside></Aside>
      </el-aside>
      <el-main class="right-main" :style="{height:bodyHeight}">
        <router-view></router-view>
      </el-main>
    </el-container>
  </div>
</template>

<script>
import Header from '../components/header/Header';
import Aside from '../components/aside/Aside';
export default {
  data(){
    return{
      bodyHeight:window.innerHeight - 61 + "px",
    }
  },
  components:{
    Header,
    Aside,
  },
  mounted() {
    window.onresize = () => {
      this.bodyHeight = window.innerHeight - 61 + "px";
    };
  },

}
</script>

<style lang="less">
.header-nav{
  height: 6rem;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
}
.aside-nav{
  position: fixed;
  top: 6rem;
  left: 0;
  z-index: 100;
  height: 100%;
}
.right-main{
  margin-top: 6rem;
  margin-left: 20rem;
  background-color: #F5F9FC;
} 
</style>

